package cn.itcast.service.impl;

import cn.itcast.dao.UserDao;
import cn.itcast.domain.User;
import cn.itcast.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Date :17:06 2021/6/13
 * @Author :xuhe
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User findUser(String userid, String password) {
        System.out.println("查找验证用户");
        User user=userDao.findUser(userid,password);
        return user;
    }

    @Override
    public void saveUser(User user) {
        System.out.println("保存账户");
        userDao.saveUser(user);
    }

    @Override
    public void updateUser(User user) {
        System.out.println("更新账户");
        userDao.updateUser(user);
    }

    @Override
    public User findUserByid(String userid) {
        User user=userDao.finUserByid(userid);
        return user;
    }

    public void updateUserinfo(User user) {
        userDao.updateUserinfo(user);

    }
}
